﻿package server_common;
import haxe.Md5;

extern class Api {
	static function __init__():Void untyped {
        __call__("require_once", "api.php");
    }
	
	public var api_id: String;
	public var api_secret: String;
	public var v: String;
	public var format: String;
	public var server: String;
	public var error: String;
	
	public function new(api_id: String, api_secret: String): Void;
	
	public function isAuthorizedCall(auth_key: String, viewer_id: String): Bool;
	
	public function addRating(uid: Int, rate: Int, ? message: String = null): Bool;
	
	public function setCounter(uid: Int, counter: Int): Bool;
	
	public function getAppBalanse(): Int;
	
	public function sendNotification(uids: Array<Int>, message: String): Bool;

	public function saveAppStatus(uid: Int, status: String): Bool;
	
	public function getAppStatus(uid: Int): String;
	
	public function getBalanse(uid: Int): Int;
	
	public function addVotes(uid: Int, count: Int): Int;
	
	public function withdrawVotes(uid: Int, count: Int): Bool;
	
	public function transferVotes(from: Int, to: Int, count: Int): Bool;
}